<?php
  /**
   * Kontrollbase
   *
   * An open source MySQL monitoring and analytics application
   *
   * @package Kontrollbase
   * @author Matt Reid
   * @copyright Copyright (c) 2009 Matt Reid, Kontrollbase LLC
   * @license http://kontrollsoft.com/kontrollbase/userguide/general-LICENSE.php
   * @link http://kontrollbase.com
   */

class Main extends Controller {

  function Main()
  {
    parent::Controller();
  }

  function index() {	  
    log_message('debug', "main_controller_index function called");
    check_variables(); // ensure compress_output is set to FALSE in the config
    check_writeable(); // make sure directories are writeable that need to be - runs helper filecheck_helper
    check_files(); // make sure config files exist - runs helper filecheck_helper
    log_message('debug', "main_index init checks finished, continuing...");
    $g['root'] = $this->config->item('base_url');
    $_SESSION['example'] = $g['root'];	  // we set this for the header files that don't use CI sessions
    $this->load->view('main/grouptabs',$g);
  }

  function hostbindings() {
    log_message('debug', "main_hostbindings:: function starting");
    $this->load->model('Model_main', 'main');
    $g['host_list'] = $this->main->get_hostbindings();
    $g['root'] = $this->config->item('base_url');

    $this->load->view('bindings/show_hostbindings',$g);
  }

  function commandbindings() {
    log_message('debug', "main_commandbindings:: function starting");
    $this->load->model('Model_main', 'main');
    $g['binding_list'] = $this->main->get_commandbindings();
    $g['root'] = $this->config->item('base_url');

    $this->load->view('bindings/show_commandbindings',$g);
  }

}

?>